package com.lanou.controller;

import com.lanou.service.CompanyInfoService;
import com.lanou.utils.AjaxResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dllo on 18/3/12.
 */
@Controller
public class CompanyInfoController {
    @Resource
    private CompanyInfoService companyInfoService;

    /**
     *
     * @param id
     * @return 公司简介
     * 开发人:赵帅
     */
    @ResponseBody
    @RequestMapping("/comInfo")
    public AjaxResult getCompanyInfo(@RequestParam("id") int id){
    return companyInfoService.getCompanyPro(id);
    }

    /**
     *
     * @param id
     * @return 公司资质证书
     * 开发人:赵帅
     */
    @ResponseBody
    @RequestMapping("/comCer")
    public AjaxResult getCompanyCertificate(@RequestParam("id") int id){
        return companyInfoService.getQualifcation(id);
    }

    /**
     *
     * @param id
     * @return 公司营业执照
     * 开发人:赵帅
     */
    @ResponseBody
    @RequestMapping("/busLic")
    public AjaxResult getBusinessLicence(@RequestParam("id") int id){
        return companyInfoService.getBusinessLicence(id);
    }

    /**
     *
     * @param id
     * @return 公司的荣誉证书图片地址
     * 开发人:赵帅
     */
    @ResponseBody
    @RequestMapping("/honCer")
    public AjaxResult getHonorCer(@RequestParam("id") int id){
        return companyInfoService.getHonorCer(id);
    }

    /**
     *
     * @param id
     * @return 公司的注册信息
     * 开发人:赵帅
     */
    @ResponseBody
    @RequestMapping("/regMsg")
    public AjaxResult getRegistMsg(@RequestParam("id") int id){
        return companyInfoService.getRegistMsg(id);
    }

    /**
     *
     * @param id
     * @return 此公司的文章资讯和内容
     * 开发人:赵帅
     */
    @ResponseBody
    @RequestMapping("/article")
    public AjaxResult getArticles(@RequestParam("id") int id ){
        return companyInfoService.getArticles(id);
    }


    /**
     *
     * @param id 公司id
     * @return 此公司的优惠信息
     * 开发人:赵帅
     */
    @ResponseBody
    @RequestMapping("/decfav")
    public AjaxResult getDecorateFavour(@RequestParam("id") int id){
        return companyInfoService.getDecorateFavour(id);
    }

    /**
     *
     * @param id 公司id
     * @return 获取此公司的联系方式信息
     * 开发人:赵帅
     */
    @ResponseBody
    @RequestMapping("/contact")
    public AjaxResult getContact(@RequestParam("id") int id){
        return companyInfoService.getContact(id);
    }
}
